package com.lipaluma.examples.annotation.taggedClient;

import java.util.List;

import com.lipaluma.annotations.mapping.MapColumn;
import com.lipaluma.annotations.merge.Merge;
import com.lipaluma.annotations.merge.MergeTarget;
import com.lipaluma.annotations.merge.OneToMany;
import com.lipaluma.field.merge.FieldMergedAlgorithmEnum;

@MergeTarget
@CSV(delimiter=';', writeHeader=true)
public class Client {
	@MapColumn(index=1)
	private long id;
	@MapColumn(index=2)
	private String nom;
	
	@Merge(value=FieldMergedAlgorithmEnum.ADD_ALL)
	@OneToMany
	private List<Invoice> invoices;

	@MapColumn(index=5)
	@Merge(value=FieldMergedAlgorithmEnum.ADD_ALL)
	@OneToMany
	private List<Tag> tags;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public List<Invoice> getInvoices() {
		return invoices;
	}

	public void setInvoices(List<Invoice> invoices) {
		this.invoices = invoices;
	}

	public List<Tag> getTags() {
		return tags;
	}

	public void setTags(List<Tag> tags) {
		this.tags = tags;
	}
}
